package com.code.base.info.service;

import java.util.List;
import java.util.Date;
import java.util.Map;
import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.code.base.info.persistence.InfoHouseMapper;
import com.code.base.info.pojo.InfoHouse;
import com.code.util.PrimaryKeyUtil;


@Service
public class InfoHouseService {


	@Resource
	private InfoHouseMapper infoHouseMapper;

	public Long getInsertId() {
		return PrimaryKeyUtil.generatePrimaryKey();
	}

	public InfoHouse getDataById(Long id) {
		return infoHouseMapper.getDataById(id);
	}

	public List<InfoHouse> getAllData() {
		return infoHouseMapper.getAllData();
	}

	public int getDataCountByCondition(InfoHouse entity) {
		return infoHouseMapper.getDataCountByCondition(entity);
	}

	public List<InfoHouse> getDataByCondition(InfoHouse entity) {
		return infoHouseMapper.getDataByCondition(entity);
	}

	public int getDataCountByLikeCondition(InfoHouse entity) {
		return infoHouseMapper.getDataCountByLikeCondition(entity);
	}

	public List<InfoHouse> getDataByLikeCondition(InfoHouse entity) {
		return infoHouseMapper.getDataByLikeCondition(entity);
	}

	public List<InfoHouse> getDataByIds(Long[] ids) {
		return infoHouseMapper.getDataByIds(ids);
	}

	public void insertData(InfoHouse entity) {
		insertData(entity, true);
	}

	public void insertData(InfoHouse entity, boolean setIdValue) {
		if (setIdValue) {
			entity.setId(getInsertId());
		}
		infoHouseMapper.insertData(entity);
	}

	public void updateData(InfoHouse entity) {
		infoHouseMapper.updateData(entity);
	}

	public void updateDataByParam(Map<String, Object> map) {
		if (map.size() == 0)
			return;

		infoHouseMapper.updateDataByParam(map);
	}

	public void deleteDataByObject(InfoHouse entity) {
		infoHouseMapper.deleteDataByObject(entity);
	}

	public void deleteDataById(Long id) {
		infoHouseMapper.deleteDataById(id);
	}

	public void deleteDataByIds(Long[] ids) {
		infoHouseMapper.deleteDataByIds(ids);
	}

}
